package bootstrap

import (
	"go-mp-starter/global"

	"github.com/jassue/go-storage/kodo"
	"github.com/jassue/go-storage/local"
	"github.com/jassue/go-storage/oss"
)

func InitStorage() {
	diskCfg := global.App.Config.Storage.Disks
	// 初始化本地文件驱动
	_, _ = local.Init(diskCfg.Local)

	// 初始化阿里云文件驱动
	if diskCfg.AliOss.Endpoint != "" {
		_, _ = oss.Init(diskCfg.AliOss)
	}
	// 初始化七牛云驱动
	if diskCfg.QiNiu.Domain != "" {
		_, _ = kodo.Init(diskCfg.QiNiu)
	}
}
